package com.example.demo.demoApi.msg;

import com.example.demo.demoApi.apiHandler.ApiRequestHeader;
import com.example.demo.demoApi.body.RequestBody;

public abstract class ExternalMsg<T extends RequestBody> extends AbstractMsg {

    /**
     * channel id，在socket、websocket、http下标识连接通道
     */
    protected String channelId;

    protected String requestId;

    protected String content;

    /**
     * 消息类型
     */
    protected String msgType = this.getClass().getName();

    protected ApiRequestHeader header = new ApiRequestHeader();

    public String getChannelId() {
        return channelId;
    }

    public void setChannelId(String channelId) {
        this.channelId = channelId;
    }

    public String getRequestId() {
        return requestId;
    }

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getMsgType() {
        return msgType;
    }

    public void setMsgType(String msgType) {
        this.msgType = msgType;
    }

    public ApiRequestHeader getHeader() {
        return header;
    }

    public void setHeader(ApiRequestHeader header) {
        this.header = header;
    }

    public abstract T getBody();

}

